import 'package:flutter/material.dart';
import 'package:flutter_base_study/navigator/Page02.dart';
import 'package:flutter_base_study/navigator/page03.dart';

class Page01 extends StatelessWidget {
  const Page01({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Page01'),
      ),
      body: ElevatedButton(
          onPressed: () {
            Navigator.push(
              context,
              MaterialPageRoute(
                // builder: (_) => Page02(
                //       data_from_page01: 'page01传值到page02',
                //     )),
                builder: (_) => Page03(
                  data_from_page01: 'page01传值到page03',
                ),
              ),
            );
          },
          child: Text('下一页 navigator.push')),
    );
  }
}
